<!DOCTYPE html>
<html>
<head>
<title>Weiran ECMAScript Applications Framework</title>
<link rel=stylesheet type=text/css href=./style.css>
</head>

<body>

<div class=leftbar>
    <h1>Weiran</h1>
    <p>ECMAScript<br />Applications Framework</p>
    <p>Version: 1.2</p>
    <ul>
	<li><a href=Weiran.html>Weiran</a></li>
	<li><a href=Weiran.Array.html>Weiran.Array</a></li>
	<li><a href=Weiran.Buffer.html>Weiran.Buffer</a></li>
	<li><a href=Weiran.Class.html>Weiran.Class</a></li>
	<li><a href=Weiran.Date.html>Weiran.Date</a></li>
	<li><a href=Weiran.DB.html>Weiran.DB</a></li>
	<li><a href=Weiran.Event.html>Weiran.Event</a></li>
	<li><a href=Weiran.Events.html>Weiran.Events</a></li>
	<li><a href=Weiran.Function.html>Weiran.Function</a></li>
	<li><a href=Weiran.JSON.html>Weiran.JSON</a></li>
	<li><a href=Weiran.Lang.html>Weiran.Lang</a></li>
	<li>Weiran.Number<ul>
	    <li><a href=#Weiran.Number.limitSigDigs>Weiran.Number.limitSigDigs</a></li>
	    <li><a href=#Weiran.Number.limitFixDigs>Weiran.Number.limitFixDigs</a></li>
	    <li><a href=#Weiran.Number.format>Weiran.Number.format</a></li>
	    <li><a href=#Weiran.Number.zeroize>Weiran.Number.zeroize</a></li>
	</ul></li>
	<li><a href=Weiran.String.html>Weiran.String</a></li>
	<li><a href=Weiran.GRUB.html>GRUB Mechanism</a></li>
    </ul>
    <p>
        Copyright &copy; All<span>i</span>dylls<br />
        2011 - 2012
    </p>
</div>

<div class=content>

<div class=reftitle>Weiran.Number</div>
<p>Sub namespace contains convenience functions for number manipulation.</p>

<a name=Weiran.Number.limitSigDigs></a>
<h3><code>Weiran.Number.limitSigDigs(num, sig)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>num</span> - <code>number</code>, float instance of <code>Number</code><br />
    <span class=parameters>sig</span> - <code>number</code>, number of significant digits
</p>
<p><b>Returns: </b><code>number</code></p>
<p>Returns the number, rounded to the specified number of significant digits.</p>

<a name=Weiran.Number.limitFixDigs></a>
<h3><code>Weiran.Number.limitFixDigs(num, fix)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>num</span> - <code>number</code>, float instance of <code>Number</code><br />
    <span class=parameters>fix</span> - <code>number</code>, number of fixed decimal digits
</p>
<p><b>Returns: </b><code>number</code></p>
<p>Returns the number, rounded to the specified number of decimal digits.</p>

<a name=Weiran.Number.format></a>
<h3><code>Weiran.Number.format(num, dec, tsep, dsep)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>num</span> - <code>number</code>, float instance of <code>Number</code><br />
    <span class=parameters>dec</span> - <code>number</code>, integer of decimal places to round to, defaults to 0<br />
    <span class=parameters>tsep</span> - <code>string</code>, thousands separator, default is ","<br />
    <span class=parameters>dsep</span> - <code>string</code>, decimal separator, default is "."
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Returns a string representing the formatted number.</p>

<a name=Weiran.Number.zeroize></a>
<h3><code>Weiran.Number.zeroize(num, length)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>num</span> - <code>number</code><br />
    <span class=parameters>length</span> - <code>number</code>, length of returned string, defaults to 2
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Returns a zero-prefixed string of value which length is specified length or 2 by default.</p>

</div>

</body>
</html>
